package enhance.plus.logic;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author liubo
 */
@Data
public class LogicBaseEntity implements Serializable{

	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@ApiModelProperty(value = "ID")
	@TableId(value = "ID", type = IdType.AUTO)
	private String id;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	@TableField(value = "CREATE_USER" , fill = FieldFill.INSERT )
	private String createUser;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	@TableField(value="create_time", fill = FieldFill.INSERT )
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	/**
	 * 最后修改时间
	 */
	@ApiModelProperty(value = "最后修改时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField(value ="last_modification_time", fill = FieldFill.INSERT_UPDATE )
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lastModificationTime;

	/**
	 * 删除[0:正常,1:删除]
	 */
	@TableLogic
	@ApiModelProperty(value = "删除[0:正常,1:删除]")
	@TableField(value ="remove_flag" , fill = FieldFill.INSERT )
	private Integer removeFlag;

}
